import request from "@/router/axios";
// 查询
export const getList = (current, size, params, improveMeasure) => {
  return request({
    url: "/api/hg-quality/prolist/page",
    method: "get",
    params: {
      ...params,
      current,
      size,
      improveMeasure
    }
  });
};

// 根据子表id  所在表  获取主表id
export const getId = params => {
  return request({
    url: "/api/hg-quality/prolist/getId",
    method: "get",
    params
  });
};
// 详情
export const getDetail = params => {
  return request({
    url: "/api/hg-quality/prolist/detail",
    method: "get",
    params: {
      ...params
    }
  });
};

// D1保存
export const D1Save = (data, type) => {
  return request({
    url: `/api/hg-quality/prolistgroup/${type}`,
    method: "post",
    data
  });
};
// D1 启动流程
export const D1Start = id => {
  return request({
    url: `/api/hg-quality/prolistgroup/start-process`,
    method: "post",
    params: { id }
  });
};
// D2保存
export const D2Save = (data, type) => {
  return request({
    url: `/api/hg-quality/prolistexplain/${type}`,
    method: "post",
    data
  });
};
// D2 启动流程
export const D2Start = id => {
  return request({
    url: `/api/hg-quality/prolistexplain/start-process`,
    method: "post",
    params: { id }
  });
};
// D3保存
export const D3Save = (data, type) => {
  return request({
    url: `/api/hg-quality/prolisttem/${type}`,
    method: "post",
    data
  });
};
// D3 启动流程
export const D3Start = id => {
  return request({
    url: `/api/hg-quality/prolisttem/start-process`,
    method: "post",
    params: { id }
  });
};
// D4保存
export const D4Save = (data, type) => {
  return request({
    url: `/api/hg-quality/prolistreason/${type}`,
    method: "post",
    data
  });
};
// D4 启动流程
export const D4Start = id => {
  return request({
    url: `/api/hg-quality/prolistreason/start-process`,
    method: "post",
    params: { id }
  });
};
// D5保存
export const D5Save = (data, type) => {
  return request({
    url: `/api/hg-quality/prolistforever/${type}`,
    method: "post",
    data
  });
};
// D5 启动流程
export const D5Start = id => {
  return request({
    url: `/api/hg-quality/prolistforever/start-process`,
    method: "post",
    params: { id }
  });
};
// D6保存
export const D6Save = (data, type) => {
  return request({
    url: `/api/hg-quality/prolistverify/${type}`,
    method: "post",
    data
  });
};
// D6 启动流程
export const D6Start = id => {
  return request({
    url: `/api/hg-quality/prolistverify/start-process`,
    method: "post",
    params: { id }
  });
};
// D7保存
export const D7Save = (data, type) => {
  return request({
    url: `/api/hg-quality/prolistagain/${type}`,
    method: "post",
    data
  });
};
// D7 启动流程
export const D7Start = id => {
  return request({
    url: `/api/hg-quality/prolistagain/start-process`,
    method: "post",
    params: { id }
  });
};
// D8保存
export const D8Save = (data, type) => {
  return request({
    url: `/api/hg-quality/prolistcelebrate/${type}`,
    method: "post",
    data
  });
};
// D8 启动流程
export const D8Start = id => {
  return request({
    url: `/api/hg-quality/prolistcelebrate/start-process`,
    method: "post",
    params: { id }
  });
};

// 获取部门树
export const getDeptTree = () => {
  return request({
    url: `/api/blade-system/dept/tree`,
    method: "get"
  });
};
// 根据部门获取人员
export const getUserByDeptID = deptId => {
  return request({
    url: `/api/blade-system/personnelinfo/getUsers`,
    method: "get",
    params: {
      deptId
    }
  });
};
